package com.study.javaOther.permission.accoperation;

import com.study.javaOther.chain.utils.MatcherUtil;

import java.util.Arrays;
import java.util.List;

public abstract class IACCOperation {

    protected final boolean resolveWildcards(String left, String right){
        return MatcherUtil.wildcardMatching(left, right);
    }

    protected final List<String> resolveSemicolon(String right){
        return right.contains(";") ? Arrays.asList(right.split(";")) : Arrays.asList(right);
    }

    protected final String resolveMatch(String left){
        return "";
    }

    public final boolean match(String left){
        return match(left,this.resolveMatch(left));
    }

    public abstract boolean match(String left, String right);
}
